home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
076-100
/
disk_084
/
ed
/
getone.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
721b
|
46 lines
/*
* Copyright 1987 Brian Beattie Rights Reserved.
*
* Permission to copy and/or distribute granted under the
* following conditions:
*
* 1). No charge may be made other than resonable charges
* for reproduction.
*
* 2). This notice must remain intact.
*
* 3). No further restrictions may be added.
*
*/
#include <stdio.h>
#include "tools.h"
#include "ed.h"
getone()
{
int c, i, num;
if((num = getnum()) >= 0)
{
while(1)
{
while(*inptr == SP || *inptr == HT)
inptr++;
if(*inptr != '+'&& *inptr != '-')
break;
c = *inptr++;
if((i = getnum()) < 0)
return ( i );
if(c == '+')
{
num += i;
} else {
num -= i;
}
}
}
return ( num );
}